﻿using Avalonia.Controls;
using FantomNext.Presenters;
using FantomNext.Shared;

namespace FantomNext.Views;

public class MainDataContext
{
    public Scene Scene;
    public MainDataContext()
    {
        Scene = new Scene() { Id = "1" };
    }
}

public static class GlobalData
{
    public static MainDataContext MainDataContext = new MainDataContext();
    public static ScenePresenter ScenePresenter;
}

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        Loaded += MainWindow_Loaded;
    }

    private void MainWindow_Loaded(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
    {
        GlobalData.ScenePresenter = new ScenePresenter(PART_MainView.PART_SceneEditor, GlobalData.MainDataContext.Scene);
        GlobalData.ScenePresenter.LoadAsync();
    }
}
